/*品牌管理文件接口 */
import request from '@/utils/request.js'
import { getSkuInfoResponseData, getSkuResponseData } from './type.js'
import { ReqNullResponseData } from '../spu/type.js'
enum API {
  GetSkuList_URL = '/admin/product/list/',
  GetSkuInfo_URL = '/admin/product/getSkuInfo/',
  DelSkuList_URL = '/admin/product/deleteSku/',
  SALESSALE_URL = '/admin/product/onSale/',
  CANCELSALE_URL = '/admin/product/cancelSale/'
}
export const reqSkuList = (page: number, limit: number) =>
  request.get<any, getSkuResponseData>(API.GetSkuList_URL + `${page}/${limit}`)
export const reqSkuInfo = (skuID: number | string) =>
  request.get<any, getSkuInfoResponseData>(API.GetSkuInfo_URL + skuID)
export const reqDelSkuList = (skuID: number | string) =>
  request.delete<any, ReqNullResponseData>(API.DelSkuList_URL + skuID)
//已有商品上架的请求
export const reqSaveSaleSku = (skuId: number) =>
  request.get<any, ReqNullResponseData>(API.SALESSALE_URL + skuId)
//下架的请求
export const reqCancelSale = (skuId: number) =>
  request.get<any, ReqNullResponseData>(API.CANCELSALE_URL + skuId)
